package com.jt.assistant.adapter

import android.annotation.SuppressLint
import android.graphics.Color
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import coil.load
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.jt.assistant.R
import com.jt.assistant.base.BaseApplication
import com.jt.assistant.bean.Car
import com.jt.assistant.bean.CarReceiveBean
import com.jt.assistant.bean.ScanCarton

class CartonCodeListAdapter(mData: MutableList<ScanCarton>) :
    BaseQuickAdapter<ScanCarton, BaseViewHolder>(
        R.layout.item_carton_code, mData
    ) {

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: ScanCarton) {
        val tvCode = holder.getView<TextView>(R.id.tv_Code)
        val tvStatus = holder.getView<TextView>(R.id.tv_status)
        tvCode.text = item.cartonCode
        if (item.hasScan) {
            tvCode.setTextColor(Color.BLUE)
            tvStatus.setTextColor(Color.BLUE)
            tvStatus.text = "已扫码"
        } else {
            tvCode.setTextColor(Color.RED)
            tvStatus.setTextColor(Color.RED)
            tvStatus.text = "未扫码"
        }
    }


}